home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 2.0 KB | 60 lines | [TEXT/CWIE] |
- // GraphicsDeviceObject.h
-
- #ifndef GraphicsDeviceObject_h
- #define GraphicsDeviceObject_h
-
- #ifndef Rectangle_h
- #include "Rectangle.h"
- #endif
- #ifndef __PALETTES__
- #include <Palettes.h>
- #endif
-
- class GraphicsDeviceObject
- {
- private:
- GDHandle device;
-
- public:
- GraphicsDeviceObject( GDHandle theDevice )
- : device( theDevice )
- {
- Assert( device != 0 );
- Assert( *device != 0 );
- }
-
- operator GDHandle() const { return device; }
- GDHandle Device() const { return device; }
-
- int16 Driver() const { return (*device)->gdRefNum; }
-
- Rectangle Bounds() const { return (*device)->gdRect; }
-
- bool InColor() const { return TestDeviceAttribute( device, gdDevType ); }
- bool HasBlockTransfer() const { return TestDeviceAttribute( device, burstDevice ); }
- bool Needs32BitMode() const { return TestDeviceAttribute( device, ext32Device ); }
- bool InitializedFromRam() const { return TestDeviceAttribute( device, ramInit ); }
- bool IsMainScreen() const { return TestDeviceAttribute( device, mainScreen ); }
- bool AllFromResources() const { return TestDeviceAttribute( device, allInit ); }
- bool IsScreen() const { return TestDeviceAttribute( device, screenDevice ); }
- bool WithoutDriver() const { return TestDeviceAttribute( device, noDriver ); }
- bool ScreenActive() const { return TestDeviceAttribute( device, screenActive ); }
-
- bool HasDepth( uint16 depth, bool inColor ) const
- { return ::HasDepth( device, depth, gdDevType, inColor ); }
-
- void SetDepth( uint16 depth, bool inColor ) const
- { ::SetDepth( device, depth, gdDevType, inColor ); }
-
- static GDHandle First() { return GetDeviceList(); }
- GDHandle Next() const { return GetNextDevice( device ); }
-
- static GDHandle Current() { return GetGDevice(); }
- static GDHandle Main() { return GetMainDevice(); }
- static GDHandle Deepest( const Rectangle& r ) { return GetMaxDevice( &r ); }
-
- static GDHandle Nearest( const Rectangle& );
- };
-
- #endif
-